import request from '@/utils/request'

export function listCaseSet(params) {
  return request({
    url: '/test/set',
    method: 'get',
    desc: '测试集列表',
    params
  })
}

export function addCases(setId, data) {
  return request({
    url: '/test/set?c=addCases2Set&set_id=' + setId,
    method: 'post',
    desc: '添加用例到测试集',
    data
  })
}
export function editCasesSetInfo(data) {
  return request({
    url: '/test/set?c=editSet',
    method: 'post',
    paramType: 'formData',
    desc: '编辑测试用例集信息',
    data
  })
}

export function delCasesSetInfo(data) {
  return request({
    url: '/test/set?c=del',
    method: 'post',
    paramType: 'formData',
    desc: '删除此测试用例集',
    data
  })
}

export function addCase2Set(data, set_id) {
  return request({
    url: '/test/set?c=addCases2Set&set_id=' + set_id,
    method: 'post',
    desc: '新增测试用例到用例集',
    data
  })
}
export function delCase2Set(data, set_id) {
  return request({
    url: 'test/set?c=delCases',
    method: 'post',
    desc: '删除测试用例',
    data
  })
}

export function listCase(params) {
  return request({
    url: '/test/set?c=setCaseInfo',
    method: 'get',
    desc: '管理用例集列表',
    params
  })
}

export function listCaseNotInSet(params) {
  return request({
    url: '/test/case',
    method: 'get',
    desc: '管理用例集列表',
    params
  })
}

export function sortSetCase(data) {
  return request({
    url: '/test/set?c=caseSort',
    method: 'post',
    desc: '排序测试集用例',
    data
  })
}
